import java.sql.*;

public class check {
    public static void show() throws ClassNotFoundException, SQLException {
        String connectionUrl = "jdbc:sqlserver://localhost:1433;databaseName=test_1;user=sa;password=123456";
        // Declare the JDBC objects.
        Connection con = null;
        Statement stmt = null;
        ResultSet rs = null;

        // Establish the connection.
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        con = DriverManager.getConnection(connectionUrl);
        // Create and execute an SQL statement that returns some data.
        String SQL = "select * from shiyan3 ";
        stmt = con.createStatement();
        rs = stmt.executeQuery(SQL);

        // Iterate through the data in the result set and display it.
        while (rs.next()) {
            System.out.println(rs.getString(1) + "\t" + rs.getString(2) + "\t" + rs.getString(3) + "\t");
        }
    }
}

